function getItem<T>(item: T): T {
  console.log(item)
  return item
}

const item1 = getItem('hello')
getItem<string>('world')
getItem(1)

interface Lengthwise {
  length: number;
}

function logLength<T extends Lengthwise>(arg: T) {
  console.log(arg.length)
}

logLength([1, 2, 3])

function pair<K, V>(key: K, value: V): [K, V] {
  return [key, value]
}

const pair1 = pair('hello', 100)

type User = {
  name?: string
  location?: string
  age?: number
}

type User2 = Pick<User, 'name' | 'age'>

const user1: User2 = {
  name: 'John',
  age: 20
}